﻿function GSSlider(container) {
    var images = $(container + " img");
    var currentShowIndex = 0;

    this.ShowNextImage = function () {
        $(images[currentShowIndex]).fadeOut('slow', function () {
            currentShowIndex++;
            if (currentShowIndex >= images.size())
                currentShowIndex = 0;
            $(images[currentShowIndex]).fadeIn();
        })
    }

    this.Start = function () {
        setInterval(this.ShowNextImage, 4000);
    }
}